x11: Pair eglInitialize with eglTerminate
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 13 May 2021 17:23:50 +0000 (18:23 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 13 May 2021 17:23:50 +0000 (18:23 +0100)
If we bail out after EGL initialization we want to go back to a stable
state and not leave EGL hanging.

gdk/x11/gdkglcontext-egl.c

index cab476232fb096316ed626f10d5a62d1c05a68a4..08f4493a8bf8a74dbeb53a6ada2759844e23baaf 100644 (file)
@@ -596,7 +596,10 @@ gdk_x11_screen_init_egl (GdkX11Screen *screen)
    */
   const char *vendor = eglQueryString (edpy, EGL_VENDOR);
   if (strstr (vendor, "NVIDIA") != NULL)
-    return FALSE;
+    {
+      eglTerminate (edpy);
+      return FALSE;
+    }
 
   display_x11->have_egl = TRUE;
   display_x11->egl_version = epoxy_egl_version (dpy);